import echarts from "echarts";

// var hlight='000'
export default {
    // 红柱状
    NOK_Gear_boxes: {
        grid: {
            left: '0%',
            right: '0%',
            bottom: '0%',
            top: '10%',
            containLabel: true
        },
        xAxis: {
            data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'],
            axisLabel: {
                textStyle: {
                    color: '#333'
                }
            },
            axisTick: {
                show: false
            },
            axisLine: {
                show: false
            },
        },
        yAxis: {
            axisLine: {
                show: true,
                lineStyle: {
                    color: '#cccccc'
                },
            },
            axisTick: {
                show: false
            },
            axisLabel: {
                textStyle: {
                    color: '#333'
                }
            }
        },
        dataZoom: [
            {
                type: 'inside'
            }
        ],
        series: [
            {
                barWidth: '50%',
                type: 'bar',
                itemStyle: {
                    normal: {
                        barBorderRadius: 20,
                        color: function (param) {
                            if (param.name == window['hlight'])
                                return '#1a7e9c'
                            return new echarts.graphic.LinearGradient(
                                0, 0, 0, 1,
                                [
                                    { offset: 0, color: '#ff6756' },
                                    { offset: 1, color: 'rgba(249, 75, 81, 0.16)' }
                                ]
                            )
                        }
                    },
                },
                label:{
                    show:true,
                    formatter: function(params) {
                        return params.data + '%'
                    },
                    position: 'top',
                    fontStyle:'normal',
                },
                data: [234, 345, 654, 123, 753, 621, 389, 389, 245, 175, 364, 246, 226, 224, 562, 541, 533, 321, 235, 511, 233, 322, 512, 421, 451, 223, 212, 415, 241, 352, 355]
            },
        ]
    },
    // 蓝柱状
    Gearboxes: {
        grid: {
            left: '0%',
            right: '0%',
            bottom: '0%',
            top: '10%',
            containLabel: true
        },
        xAxis: {
            data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'],
            axisLabel: {
                textStyle: {
                    color: '#333'
                }
            },
            axisTick: {
                show: false
            },
            axisLine: {
                show: false
            },
        },
        yAxis: {
            axisLine: {
                show: true,
                lineStyle: {
                    color: '#cccccc'
                },
            },
            axisTick: {
                show: false
            },
            axisLabel: {
                textStyle: {
                    color: '#333'
                }
            }
        },
        dataZoom: [
            {
                type: 'inside'
            }
        ],
        series: [
            {
                barWidth: '50%',
                type: 'bar',
                itemStyle: {
                    normal: {
                        barBorderRadius: 20,
                        color: function (param) {
                            if (param.name == window['hlight'])
                                return '#1a7e9c'
                            return new echarts.graphic.LinearGradient(
                                0, 0, 0, 1,
                                [
                                    { offset: 0, color: '#569fff' },
                                    { offset: 1, color: 'rgba(75, 106, 249, 0.16)' }
                                ]
                            )
                        }
                    },
                },
                label:{
                    show:true,
                    formatter: function(params) {
                        return params.data
                    },
                    position: 'top',
                    fontStyle:'normal',
                },
                data: [234, 345, 654, 123, 753, 621, 389, 389, 245, 175, 364, 246, 226, 224, 562, 541, 533, 321, 235, 511, 233, 322, 512, 421, 451, 223, 212, 415, 241, 352, 355]
            }
        ]
    },
    // 进度条
    ProgressChart: {
        grid: {
            left: '0%',
            right: '5%',
            bottom: '0%',
            top: '5%',
            containLabel: true
        },
        xAxis: {
            splitLine: {
                show: false
            },
        },
        yAxis: {
            data: [],
            axisTick: {
                show: false
            },
            axisLabel: {
                textStyle: {
                    color: '#333'
                }
            },
            splitLine: {
                show: true,
                lineStyle: {
                    type: 'dashed'
                }
            },
        },
        series: [
            {
                barWidth: '50%',
                type: 'bar',
                itemStyle: {
                    barBorderRadius: 20,
                    color: new echarts.graphic.LinearGradient(
                        1, 0, 0, 0,
                        [
                            { offset: 0, color: '#ff6756' },
                            { offset: 1, color: 'rgba(249, 75, 81, 0.16)' }
                        ]
                    )
                },
                emphasis: {
                    itemStyle: {
                        color: new echarts.graphic.LinearGradient(
                            1, 0, 0, 0,
                            [
                                { offset: 0, color: '#ff1a00' },
                                { offset: 1, color: 'rgba(249, 75, 81, 0.5)' }
                            ]
                        )
                    }
                },
                label:{
                    show:true,
                    formatter: function(params) {
                        return params.data + '%'
                    },
                    position: 'right',
                    fontStyle:'normal',
                },
                data: []
            }
        ]
    },
    // 横向柱状 黄
    AcrossChart: {
        grid: {
            left: '0%',
            right: '5%',
            bottom: '0%',
            top: '5%',
            containLabel: true
        },
        xAxis: {
            splitLine: {
                show: false
            },
        },
        yAxis: {
            data: ['All', 'Station has \n to be \n calibrated', 'Sensor\n attached\ntoo hard'],
            axisTick: {
                show: false
            },
            axisLabel: {
                textStyle: {
                    color: '#333'
                }
            }
        },
        series: [
            {
                barWidth: '50%',
                type: 'bar',
                itemStyle: {
                    barBorderRadius: 20,
                    color: new echarts.graphic.LinearGradient(
                        1, 0, 0, 0,
                        [
                            { offset: 0, color: '#ffcc56' },
                            { offset: 1, color: 'rgba(249, 75, 81, 0.16)' }
                        ]
                    )
                },
                emphasis: {
                    itemStyle: {
                        color: new echarts.graphic.LinearGradient(
                            1, 0, 0, 0,
                            [
                                { offset: 0, color: '#ffb200' },
                                { offset: 1, color: 'rgba(249, 75, 81, 0.5)' }
                            ]
                        )
                    }
                },
                data: [234, 345, 654]
            }
        ]
    },
    // 横向柱状 黄
    ProcessWaring: {
        grid: {
            left: '0%',
            right: '8%',
            bottom: '0%',
            top: '5%',
            containLabel: true
        },
        xAxis: {
            min:0,
            max:100,
            splitLine: {
                show: false
            },
        },
        yAxis: {
            data: [],
            axisTick: {
                show: false
            },
            axisLabel: {
                textStyle: {
                    color: '#333'
                }
            }
        },
        series: [
            {
                barWidth: '50%',
                type: 'bar',
                itemStyle: {
                    barBorderRadius: 20,
                    color: new echarts.graphic.LinearGradient(
                        1, 0, 0, 0,
                        [
                            { offset: 0, color: '#ffcc56' },
                            { offset: 1, color: 'rgba(249, 75, 81, 0.16)' }
                        ]
                    )
                },
                emphasis: {
                    itemStyle: {
                        color: new echarts.graphic.LinearGradient(
                            1, 0, 0, 0,
                            [
                                { offset: 0, color: '#ffb200' },
                                { offset: 1, color: 'rgba(249, 75, 81, 0.5)' }
                            ]
                        )
                    }
                },
                label:{
                    show:true,
                    formatter: function(params) {
                        return params.data + '%' 
                    },
                    position: 'right',
                    fontStyle:'normal',
                },
                data: []
            }
        ]
    },
    // 横向柱状 黄2
    ProcessWaring2: {
        grid: {
            left: '0%',
            right: '8%',
            bottom: '0%',
            top: '5%',
            containLabel: true
        },
        xAxis: {
            min:0,
            max:100,
            type:'value',
            splitLine: {
                show: false
            },
        },
        yAxis: {
            data: ['fail'],
            axisTick: {
                show: false
            },
            axisLabel: {
                textStyle: {
                    color: '#333'
                }
            }
        },
        series: [
            {
                barWidth: '30%',
                type: 'bar',
                itemStyle: {
                    barBorderRadius: 20,
                    color: new echarts.graphic.LinearGradient(
                        1, 0, 0, 0,
                        [
                            { offset: 0, color: '#ffcc56' },
                            { offset: 1, color: 'rgba(249, 75, 81, 0.16)' }
                        ]
                    )
                },
                emphasis: {
                    itemStyle: {
                        color: new echarts.graphic.LinearGradient(
                            1, 0, 0, 0,
                            [
                                { offset: 0, color: '#ffb200' },
                                { offset: 1, color: 'rgba(249, 75, 81, 0.5)' }
                            ]
                        )
                    }
                },
                label:{
                    show:true,
                    formatter: function(params) {
                        return params.data + '%' 
                    },
                    position: 'right',
                    fontStyle:'normal',
                },
                data: []
            }
        ]
    },
    // 散点
    ScatterChart: {
        grid: {
            left: '0%',
            right: '5%',
            bottom: '0%',
            top: '5%',
            containLabel: true
        },
        xAxis: {
            type: 'time',
            splitLine: {
                lineStyle: {
                    type: 'dashed'
                }
            },
        },
        yAxis: {
            splitLine: {
                lineStyle: {
                    type: 'dashed'
                }
            },
        },
        series: [{
            symbolSize: 6,
            data: [],
            type: 'scatter',
            itemStyle: {
                color: function (param) {
                    return param.value[2]
                },
            },
            markArea: {
                itemStyle: {
                    normal: { color: '#efe7dc' },
                    emphasis: { color: '#efe7dc' }
                },
                data: [
                    [
                        {
                            yAxis: '',
                            itemStyle: {
                                color: '#efe7dc'
                            }
                        }, {
                            yAxis: ''
                        }
                    ]
                ]
            },
        }]
    },
}